home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 11
/
CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso
/
cucd
/
programming
/
oberonv4
/
source
/
system
/
l.mod
(
.txt
)
< prev
next >
Wrap
Oberon Text
|
1994-11-09
|
1KB
|
63 lines
Syntax10.Scn.Fnt
MODULE L;
IMPORT
SYSTEM,AmigaLogger;
PROCEDURE Ch*(ch:CHAR);
BEGIN
AmigaLogger.write(ch);
END Ch;
PROCEDURE Ln*;
BEGIN
Ch(0AX);
END Ln;
PROCEDURE Stamp*;
BEGIN
AmigaLogger.writeStamp();
END Stamp;
PROCEDURE Str*(str:ARRAY OF CHAR);
i:INTEGER;
BEGIN
i:=0; WHILE str[i]#0X DO Ch(str[i]); INC(i); END;
END Str;
PROCEDURE Int*(x: LONGINT);
a: ARRAY 11 OF CHAR;
i: INTEGER;
x0: LONGINT;
BEGIN i := 0;
IF x < 0 THEN
IF x = MIN(LONGINT) THEN Str(" -2147483648"); RETURN
ELSE x0 := -x
END
ELSE
x0 := x
END;
REPEAT
a[i] := CHR(x0 MOD 10 + 30H); x0 := x0 DIV 10; INC(i)
UNTIL x0 = 0;
Ch(" ");
IF x < 0 THEN Ch("-") END;
REPEAT DEC(i); Ch(a[i]) UNTIL i = 0
END Int;
PROCEDURE Hex*(x: LONGINT);
a: ARRAY 10 OF CHAR;
i: INTEGER;
y: LONGINT;
BEGIN
i := 0; Ch(" ");
REPEAT y := x MOD 10H;
IF y < 10 THEN a[i] := CHR(y + 30H) ELSE a[i] := CHR(y + 37H) END;
x := x DIV 10H; INC(i)
UNTIL i = 8;
REPEAT DEC(i); Ch(a[i]) UNTIL i = 0
END Hex;
PROCEDURE Stk*;
fp, pc, i: LONGINT;
BEGIN
SYSTEM.GETREG(14, fp);
FOR i := 1 TO 8 DO
SYSTEM.GET(fp+4, pc); SYSTEM.GET(fp, fp);
Hex(fp); Str("debug"); Hex(pc); Ln;
END;
END Stk;
END L.